package com.llmcu.graphic.designpatterns.mediator.test;

import javax.swing.*;
import java.awt.*;

/**
 * xxxx
 *
 * @author liuling
 * @date 2024/7/20 23:43
 */
public class Main {
    public static void main(String[] args) {
        JFrame frame = new JFrame();
        frame.setLayout(new GridLayout(4,2));
        Container contentPane = frame.getContentPane();

        frame.setTitle("Mediator Sample");

        JCheckBox guestLoginTypeCheckBox = new JCheckBox("guest",false);
        JCheckBox userLoginTypeCheckBox = new JCheckBox("user",true);

        JLabel nameLabel = new JLabel("name:");
        JTextField nameTextField = new JTextField(20);

        JLabel passwordLabel = new JLabel("password:");
        JPasswordField passwordField = new JPasswordField(20);

        JButton okButton = new JButton("OK");
        JButton cancelButton = new JButton("CANCEL");

        contentPane.add(guestLoginTypeCheckBox);
        contentPane.add(userLoginTypeCheckBox);
        contentPane.add(nameLabel);
        contentPane.add(nameTextField);
        contentPane.add(passwordLabel);
        contentPane.add(passwordField);
        contentPane.add(okButton);
        contentPane.add(cancelButton);
        frame.pack();
        frame.show();

    }
}
